/**    
 * Copyright by 深圳市共治物联科技有限公司 (c) 2023 Apple Inc.    
 * Date:${createTime}    
 */
package ${packageName};

import org.springframework.beans.factory.annotation.Autowired;
import ${basePackageName}.mapper.entity.${ClassName}${setting.entPostfix};
import ${basePackageName}.mapper.${ClassName}Mapper;
import ${basePackageName}.service.${ClassName}Service;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lqfp.common.base.Page;
import com.lqfp.common.base.TResult;
/**
 * @description: ${comment}
 * @author: ${author}
 * @date: ${createTime}
 **/
@Service
public class ${ClassName}ServiceImpl implements ${ClassName}Service {

    @Autowired
    private ${ClassName}Mapper ${className}Mapper;

    @Override
    public TResult<PageInfo<${ClassName}${setting.entPostfix}>> page(Page<${ClassName}${setting.entPostfix}> page) {
        PageInfo<${ClassName}> result = PageHelper.startPage(page.getPageNum(), page.getPageSize())
                                .doSelectPageInfo(()-> ${className}Mapper.select${ClassName}List(page.getParams()));
        return new TResult<>(result);
    }

    @Override
    public TResult<?> save(${ClassName}${setting.entPostfix} ${className}${setting.entPostfix}) {
        ${className}Mapper.insertSelective(${className}${setting.entPostfix});
		return new TResult<>();
    }

    @Override
    public TResult<?> updateById(${ClassName}${setting.entPostfix} ${className}${setting.entPostfix}) {
        ${className}Mapper.updateByPrimaryKeySelective(${className}${setting.entPostfix});
		return new TResult<>();
    }

    @Override
    public TResult<?> removeById(String id) {
        ${className}Mapper.deleteByPrimaryKey(id);
		return new TResult<>();
    }
}
